package com.example.demo.mall.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.demo.mall.entity.Product;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface ProductMapper extends BaseMapper<Product> {
    // 分页查询示例
    IPage<Product> selectByCategory(IPage<Product> page, @Param("categoryId") Long categoryId);

    // 商品上下架操作
    int updateStatus(@Param("id") Long id, @Param("status") Integer status);
}
